home *** CD-ROM | disk | FTP | other *** search
- Path: anvil.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Help: RCS and make.
- Date: 29 Feb 1996 08:29:02 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4h4k8eINNs0e@anvil.ugrad.cs.ubc.ca>
- References: <DnIDn2.8rK@world.std.com>
- NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
-
- In article <DnIDn2.8rK@world.std.com>,
- doug a blaisdell <dougb@world.std.com> wrote:
- >hi y'all--
- >
- >Anyone know how to get around the problem where the makefile
- >has some files that are dependent on RCS: eg:
- >
- >foo.c: RCS/foo.c,v
- > co foo.c
- >
- >And you do something like:
- >
- > co -l foo.c
- >
- >and then a:
- >
- > make foo
- >
- >Make will call RCS to checkout foo.c again. In fact,
- >every time you run make thereafter, because "co -l"
-
- Your whole problem is that you are forcing make to compare the time stamps of
- temporary check-out .c files against their ,v originals.
-
- In fact, the real dependency that you are interested in is between compiled .o
- files and RCS ,v files---the intermediate check-outs are completely
- irrelevant!!!
-
- The only pre-condition that the make rules need to ensure is that the .c files
- are checked out _if they don't exist_.
-
- The way you do this is with a rule like this:
-
- foo.c:
- co foo.c
-
- That's it! If foo.c exists, make will treat the dependency as satisfied.
- If foo.c doesn't exist, it will be checked out. It will remain check out, so
- that running make on it will not force a re-compile of a new foo.o.
-
- You then have the option of whether you make the foo.o dependent on the ,v file
- or the .c file. If you make it dependent on only the ,v file, then everytime
- someone does a co -l, it will force a re-compilation. However, the file will
- not be checked out if an old version already exists, so you will re-compile the
- out-of-date .c for nothing. If you keep foo.o dependent on the .c, then you
- will have control over what version of the project you are making. It will
- never check out an updated revision unless you force this by deleting one of
- the .c files. This is beneficial, since you probably want to use stable
- revisions of other people's code while working on yours.
-
-
- Hope this helps.
-
- Now, what is your C question? ;)
- --
-
-